home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / twi12.zip / TWIDEMO2.PAS < prev    next >
Pascal/Delphi Source File  |  1992-08-05  |  4KB  |  97 lines

  1. Program TWIDEMO2;
  2.  
  3. (***********************************************************************)
  4. (**        Text Windowing Interface Copyright David Pabst 1992        **)
  5. (**                        All Rights Reserved                        **)
  6. (**   Compuserve: 76547,2643     Relaynet: Pascal to David Pabst      **)
  7. (**                                                                   **)
  8. (** You may use, test, and\or develop software that uses TWI for      **)
  9. (** up to 1 month (31 days).  You should not release software that    **)
  10. (** uses TWI before your register. If you do, your first registration **)
  11. (** for that software must be put towards registering TWI.  Either way**)
  12. (** you must register after 31 days of use and demoing TWI.           **)
  13. (** TWI is shareware.                      YOU must register if this  **)
  14. (** software meets your needs.  Registration is $15 (US) Check or     **)
  15. (** money order.                                                      **)
  16. (**                                                                   **)
  17. (** $15 - David Pabst, 18 McAdams Road, Framingham, MA 01701, USA     **)
  18. (***********************************************************************)
  19.  
  20.  
  21. Uses Crt,TWI2;
  22.  
  23. var
  24.  Top, Bottom, J,
  25.  A, B , C , D , E , F , G , H , I : String;
  26.  Option, Fillchar                 : Char;
  27.  X, Y                             : Integer;
  28.  Done                             : Boolean;
  29.  
  30. Begin                                   (* Twi Demo 2 *)
  31.  DefaultColors;                         (* Set Colors To Defaults *)
  32.  
  33.  Top := ('TWI Demo 2 Copyright 1991 David Pabst & DSP Software   All Rights Reserved      ');
  34.  Bottom := ('ESC Exit  C Cool Display');
  35.  Fillchar := ('▒');
  36.  DrawBackGround(Top,Bottom);            (* Set The back ground up *)
  37.  
  38.  A:=('TWIDEMO2.EXE shows that');        (* Shows a sample window *)
  39.  B:=('multiple windows can be');
  40.  C:=('opened at one time.');
  41.  D:=('TWIDEMO1 can scroll windows');
  42.  DrawSmallWindow(A,B,C,D,25,8);         (* Draw a small window at 25,8 *)
  43.  TextColor(4);                          (* Text Color red *)
  44.  WriteXy(34,13,' Press Return ');       (* Tell User To Press Return *)
  45.  WaitForReturn;                         (* Wait Until Return Is Pressed *)
  46.  ClearSmallWindow(25,8);                (* Clear Window After REturn *)
  47.  Done := false;
  48.  
  49.  FGC := 5;
  50.  BGC := 2;
  51.  LC  := 4;
  52.  DrawSmallWindow(' Press C or ESC ',' C Cool Display',' ESC Exit','',25,8);
  53.  DefaultColors;
  54.  
  55.  Repeat                                 (* Until... *)
  56.   option := readkey;                    (* Get input from Keyboard *)
  57.   option := upcase(option);
  58.   case option of
  59.    #27 : Begin                          (* If Escape is pressed *)
  60.           TwiClose;                     (* Close TWI Down *)
  61.          end;
  62.    'C' : Begin                          (* cool demo windowing demo *)
  63.            a:=('TWI Copyright David Pabst');   (* Init window vars *)
  64.            b:=('TWI Copyright DSP Software');
  65.            c:=('All Rights Reserved');
  66.            d:=('Press a key to stop output.');
  67.            e:=('Line 5');
  68.            f:=('Line 6');
  69.            g:=('Line 7');
  70.            h:=('Line 8');
  71.            i:=('Line 9');
  72.            j:=('Line 10');
  73.            Bottom := ('Pressing a Key Stops Output & Returns to Main Environment');
  74.            ChangeStatusLine(Top,Bottom); (* Change status lines *)
  75.            Done := false;
  76.            Window(1,2,80,24);
  77.            Repeat
  78.              Begin
  79.                 Randomize;               (* Randomize computer *)
  80.                  delay(125);             (* Delay 125 Milliseconds *)
  81.                  drawmediumwindow(a,b,c,d,e,f,(random(30)),(random(16)));
  82.                  drawsmallwindow(a,b,c,d,(random(45)),(random(17)));
  83.                  drawlargewindow(a,b,c,d,e,f,g,h,i,j,(random(25)),(random(13)));
  84.              End;
  85.            Until keypressed;             (* Until Keypressed *)
  86.            Bottom := ('ESC Exit  C Cool Display'); (* Change status line back *)
  87.            Window(1,1,80,25);
  88.            DrawBackGround(top,bottom); (* Reset BackGround;  *)
  89.            FGC := 5;
  90.            BGC := 2;
  91.            LC  := 4;
  92.            DrawSmallWindow(' Press C or ESC ',' C Cool Display',' ESC Exit','',25,8);
  93.            DefaultColors;
  94.          End;
  95.       End;
  96.  Until Done;
  97. End.                                   (* Twi Demo 2 *)